﻿<%@ page language="java" import="java.util.*" contentType="text/html"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta name="renderer" content="webkit">
		<title>登陆艾特律师后台</title>
		<link rel="stylesheet"
			href='<c:url value="/share/pintuer.css"></c:url>' />
		<link rel="stylesheet" href='<c:url value="/share/admin.css"></c:url>' />
		<script type="text/javascript"
			src='<c:url value="/js/jquery.js"></c:url>'></script>
		<script type="text/javascript"
			src='<c:url value="/js/pintuer.js"></c:url>'></script>
		<script type="text/javascript"
			src='<c:url value="/js/admin.js"></c:url>'></script>
		<link type="image/x-icon" href="http://www.pintuer.com/favicon.ico"
			rel="shortcut icon" />
</head>

<body>
	<div class="container">
		<div class="line">
			<div class="xs6 xm4 xs3-move xm4-move">
				<br /> <br />
				<div class="media media-y">
					<img src="<c:url value="/share/img/webmaster.png"></c:url>"
						alt="后台管理系统" />
				</div>
				<br /> <br />
				<div class="panel">
					<div class="panel-head">
						<strong>登录艾特律师后台管理系统</strong>
					</div>
					<div class="panel-body" style="padding: 30px;">
						<div class="form-group">
							<div class="field field-icon-right">
								<input type="text" class="input" name="username"
									placeholder="登录账号"
									data-validate="required:请填写账号,length#>=5:账号长度不符合要求" /> <span
									class="icon icon-user"></span>
							</div>
						</div>
						<div class="form-group">
							<div class="field field-icon-right">
								<input type="password" class="input" name="pwd"
									placeholder="登录密码"
									data-validate="required:请填写密码,length#>=6:密码长度不符合要求" /> <span
									class="icon icon-key"></span>
							</div>
						</div>
						<!--<div class="form-group">
									<div class="field">
										<input type="text" class="input" name="passcode" placeholder="填写右侧的验证码" data-validate="required:请填写右侧的验证码" />
										<img src="images/passcode.jpg" width="80" height="32" class="passcode" />
									</div>
								</div>-->
					</div>
					<div class="panel-foot text-center">
						<button class="button button-block bg-main text-big" id="at_login">立即登录</button>
					</div>
				</div>
				<!--<div class="text-right text-small text-gray padding-top">基于<a class="text-gray" target="_blank" href="http://www.pintuer.com">拼图前端框架</a>构建</div>-->
			</div>
		</div>
	</div>
</body>
<script>
	var rootPath = '${rootPath}';

	$("#at_login").click(function() {
		var username = $('input[name="username"]').val();
		var pwd = $('input[name="pwd"]').val();
		//alert(pwd);			
		if (username.length >= 5 && pwd.length >= 6) {
			var url = '<c:url value="/userMng/login"></c:url>';
			//var url = get_url()+'userMng/login';
			$.ajax({
				type : "post",
				url : url,
				dataType : 'JSON',//加入这个选项即可
				data : {
					'userName' : username,
					'password' : pwd
				},
				success : function(json) {
					if(json){
						
					}else{
						
					}
					if (json == true) {
						location.href = '<c:url value="/userMng/page"></c:url>';
					} else {
						// TODO
						alert("登录失败！！！！");
					}
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert("错误提示!!!!");
				}
			});
		} else {
			alert("账号或者密码为空！！！");
			return false;
		}
	});
</script>
</html>